Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC of typed extension views for arbitrary list of extensions. #700

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

brabeji
Copy link

@brabeji brabeji commented Sep 1, 2024

I spent some time on this, so I'm sharing it as a short draft. LMK if this is the right direction for the API.

json-joy is impressive stuff, thank you @streamich

@@ -44,4 +47,10 @@ export interface JsonNode<View = unknown> extends Identifiable {
api: undefined | unknown; // JsonNodeApi<this>;
}

export type JsonNodeView<N> = N extends JsonNode<infer V> ? V : {[K in keyof N]: JsonNodeView<N[K]>};
export type JsonNodeView<N> = N extends ExtNode<any, infer V>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the first branch is necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant